package com.cloud.rapid.screen.controller;

import com.cloud.rapid.screen.dto.SysUserDTO;
import com.cloud.rapid.screen.service.SysUserService;
import com.cloud.rapid.screen.util.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    SysUserService userService;

    @GetMapping("/listByQuery")
    public ApiResponse<List<SysUserDTO>> listByQuery(String name) {
        List<SysUserDTO> data = userService.listByQuery(name);
        return ApiResponse.ok(data);
    }
}
